src = $(wildcard *.c)
target = $(patsubst %.c, %, $(src))

ALL:$(target)
%:%.c
	gcc $< -o $@

clean:
	-rm -rf *.o test1 test2 test3

.PHONY:clean ALL